
//不同表格的option
export const getTableOption = (type, safe) => {
    const columMap = {
        workshop: [
            {
                label: '车间编码',
                prop: 'objectCode',
                type: 'search',
                search: true,
                searchType: 'input',
                disabled: true,
                rules: [
                    {
                        required: true,
                        message: '请选择车间编码',
                        trigger: 'blur'
                    }
                ],
                appendClick: () => {
                    safe.openWorkshopCommonModal();
                }
            },
            {
                label: '车间名称',
                prop: 'objectName',
                search: true,
                disabled: true
            },
            {
                label: '直通率目标值(%)',
                prop: 'fpyGoal',
                type: 'number',
                precision: 0,
                minRows: 1,
                maxRows: 100,
                rules: [{ required: true, validator: safe.validGoalFpy, trigger: 'submit' }]
            },
            {
                label: '',
                prop: 'continueUse',
                type: 'checkbox',
                hide: true,
                dicData: [
                    {
                        label: '该工厂内所有车间、所有产线都沿用该目标',
                        value: 'CHECKBOX'
                    }
                ]
            }
        ],
        product: [
            {
                label: '产品编码',
                prop: 'objectCode',
                type: 'search',
                search: true,
                searchType: 'input',
                disabled: true,
                rules: [
                    {
                        required: true,
                        message: '请选择产品编码',
                        trigger: 'blur'
                    }
                ],
                appendClick: () => {
                    safe.openPartCommonModal();
                }
            },
            {
                label: '产品名称',
                prop: 'objectName',
                search: true,
                disabled: true
            },
            {
                label: '产品型号',
                prop: 'partModel',
                search: true,
                disabled: true
            },
            {
                label: '直通率目标值(%)',
                prop: 'fpyGoal',
                type: 'number',
                precision: 0,
                minRows: 1,
                maxRows: 100,
                rules: [{ required: true, validator: safe.validGoalFpy, trigger: 'submit' }]
            }
        ],
        productLine: [
            {
                label: '产线编码',
                prop: 'objectCode',
                type: 'search',
                search: true,
                searchType: 'input',
                disabled: true,
                rules: [
                    {
                        required: true,
                        message: '请选择产线编码',
                        trigger: 'blur'
                    }
                ],
                appendClick: () => {
                    safe.openLineCommonModal();
                }
            },
            {
                label: '产线名称',
                prop: 'objectName',
                search: true,
                disabled: true
            },
            {
                label: '直通率目标值(%)',
                prop: 'fpyGoal',
                type: 'number',
                precision: 0,
                minRows: 1,
                maxRows: 100,
                rules: [{ required: true, validator: safe.validGoalFpy, trigger: 'submit' }]
            }
        ]
    };
    return columMap[type];
};